package com.epalmpay.service.yunstream;


import com.epalmpay.dto.datareport.BaseReportInDTO;
import com.epalmpay.dto.datareport.ObdReportListOutDTO;
import com.epalmpay.entity.*;
import com.epalmpay.exception.ApplicationException;
import com.epalmpay.dto.system.BaseOutDTO;
import com.epalmpay.dto.yunliu.obd.*;
import org.apache.ibatis.annotations.Param;
import sun.management.resources.agent;

import java.util.List;
import java.util.Map;

/**
 * Created by wzq on 2017/7/2.
 */
public interface IObdService {

	public ObdStoreListOutDTO getStoreList(ObdInDTO obdInDTO) throws Exception;
	public int deleteObd(ObdInDTO obdInDTO) throws Exception;
	public int deleteObdForBatch(ObdAddInDTO obdAddInDTO) throws Exception;

	public ObdStoreListOutDTO getStoreBatchList(ObdInDTO obdInDTO) throws Exception;
	public ObdStoreListOutDTO getStoreBatchItemList(ObdInDTO obdInDTO) throws Exception;

	public ObdDistributionListOutDTO getDistributionList(ObdInDTO obdInDTO) throws Exception;
	public int deleteObdDistribution(ObdInDTO obdInDTO) throws Exception;

	public int deleteDistributeForBatch(ObdAddInDTO obdAddInDTO) throws Exception;

	public ObdDistributionListOutDTO getDistributionBatchList(ObdInDTO obdInDTO) throws Exception;

	public ObdDistributionListOutDTO  getDistributionBatchItemList(ObdInDTO obdInDTO) throws Exception;

	public ObdDetailOutDTO getObdDetail(ObdInDTO obdInDTO) throws Exception;

	public ObdOutDTO toObdStoreAdd(ObdAddInDTO obdAddInDTO) throws Exception;
	public int addStore(ObdAddInDTO obdAddInDTO) throws Exception;
	public int addDeviceDistribution(ObdAddInDTO obdAddInDTO) throws Exception;

	public ObdShopListOutDTO getShopOBDList(ObdInDTO obdInDTO) throws Exception;

	public ObdAgentListOutDTO getAgentOBDList(ObdInDTO obdInDTO) throws Exception;

	public int updateObdActivate(String thirdUserId,String deviceId,String activateTime,String sign) throws Exception;


	public ObdPurchaseApplyListOutDTO getPurchaseApplayList(ObdInDTO obdInDTO) throws Exception;
	public ObdApplyStepListOutDTO getOpertorApplayList(ObdInDTO obdInDTO) throws Exception;


	public ObdPurchaseApplyOutDTO getObdSigleAmount(ObdInDTO obdInDTO) throws Exception;
	public ObdSmOutDTO getObdSmUrl(ObdSmOutDTO obdSmOutDTO) throws Exception;
	public ObdPurchaseApplyOutDTO getObdNumAndSigleAmount(ObdInDTO obdInDTO) throws Exception;

	int insertObdPurchaseApplay(YsObdPurchaseApply data);

	int updateNumAndAmountApply(YsObdPurchaseApply data);
	int updatePayType(YsObdPurchaseApply data);
	int updateRemitCommit(YsObdPurchaseApply data);
	int confirmPayCommit(YsObdPurchaseApply data);

	int updatePurchaseApplyStatus(YsObdPurchaseApply data);
	int updateLogistics(YsObdPurchaseApply data);

	public ObdPurchaseApplyOutDTO getObdApplayInfo(Long id) throws Exception;

    YsObdPurchaseSetOutDTO getObdPurchaseParamSettingByGroupId(YsObdPurchaseSet ysObdPurchaseSet) throws ApplicationException;
	ObdPurchaseApplyOutDTO getObdLogisticsById(YsObdPurchaseApply data) throws ApplicationException;

    BaseOutDTO saveObdPurchaseParamSetting(YsObdPurchaseSet ysObdPurchaseSet) throws ApplicationException;

	//更换OBD
	int changeOBD(Map<String, Object> param);

	//更新新OBD的device
	int updateOBDByDevice(Map<String, Object> param);

	//添加OBD更换记录
	int insertObdChange(Map<String, Object> param);

	//查找该obd设备号是否属于该用户
	int selectOwnObdByDeviceid(Map<String, Object> param);

	//根据设备号查询obd
	YsObd selectObdByDeviceId(String deviceId);


    List getGroupMonthList(Map map)throws ApplicationException;

	List<Agent> queryAgentIdsByGroupId(Long groupid, Integer level);

	List<Shop> queryShopIdByGroupId(Long groupid);

    List<Map<String,Object>> getObdDayList(Map map)throws ApplicationException;

    List<Map<String,Object>> getObdMonthList(Map map)throws ApplicationException;

	List queryObdDataReportList(Map map)throws ApplicationException;

	ObdDataReportListOutDTO queryAgentOrShopObdList(ObdDataReportInDTO obdDataReportInDTO, Page page)throws ApplicationException;

//    ObdDataReportListOutDTO queryObdDataReportList(ObdDataReportInDTO obdDataReportInDTO, Page page)throws ApplicationException;;

    public ObdStoreListOutDTO getCancelList(ObdInDTO obdInDTO) throws Exception;

    //更新新OBD的device
    int updateOBDValid(Map param);

    List getGroupMonthList2(Map map)throws ApplicationException;

	List getGroupMonthList3(Map map)throws ApplicationException;
}
